package com.ht.medicaltreatment.adapter

import android.widget.LinearLayout
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.ht.medicaltreatment.R
import com.ht.medicaltreatment.bean.LoanSample

class BorrowDetailAdapter(status:Int) : BaseQuickAdapter<LoanSample,BaseViewHolder>(R.layout.item_borrow_detail_layout) {
    private var status = status
    override fun convert(holder: BaseViewHolder, item: LoanSample) {
        val ll = holder.getView<LinearLayout>(R.id.llTab)
        if(item.isChecked){
            ll.isSelected = true
        }else{
            ll.isSelected = false
        }
        holder.setText(R.id.tvCode,"${getItemPosition(item)+1}")
        holder.setText(R.id.tvName,item.name)
        holder.setText(R.id.tvState,if (status == 0) "未盘点" else "已盘点")
    }
}
